package com.example.demo.service;

import com.example.demo.common.AjaxResult;
import com.example.demo.entity.Userinfo;
import com.example.demo.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @program: demo
 * @author: JCM
 * @create: 2023-07-31 18:29
 * @description:
 **/
@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public int reg(Userinfo userinfo) {
        return userMapper.reg(userinfo);
    }

    public Userinfo selectByUsername(String username) {
        return userMapper.selectByUsername(username);
    }

    public Userinfo getUserById(Integer id) {
        return userMapper.getUserById(id);
    }
}
